home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / E-G / Get-SetVolume.cpt / GetVolume.Pas < prev    next >
Pascal/Delphi Source File  |  1989-02-26  |  1KB  |  56 lines

  1. {$R-}
  2. {
  3.     GetVolume -- An HyperCard XFCN that will return the volume of the speaker.
  4.     
  5.         Written by Steven Kienle, CIS account number 72330,111
  6.     
  7.     GetVolume should be called in HyperCard as
  8.         GetVolume()
  9.     The parentheses are required.
  10.     
  11.     After compiling this program, link it with the GetVolume.Link, then use
  12.     ResEdit to move the XFCN resource to the appropriate stack.  Or use the
  13.     GetVolume/SetVolume stack's Install button.
  14.     
  15.     NOTE:  for the XCmdGlue.inc file to work with TML Pascal, a few 
  16.            modifications are required.
  17. }
  18.  
  19. {$S GetVolume }     { Segment name must be the same as the command name. }
  20.  
  21. UNIT DummyUnit;
  22.  
  23. INTERFACE
  24.  
  25. USES MacIntf, HyperXCmd;
  26.  
  27. PROCEDURE ENTRYPOINT(paramPtr: XCmdPtr);
  28.     
  29. IMPLEMENTATION
  30.  
  31. PROCEDURE GetVolume(paramPtr: XCmdPtr); FORWARD;
  32.  
  33.   PROCEDURE ENTRYPOINT(paramPtr: XCmdPtr);
  34.   BEGIN
  35.     GetVolume(paramPtr);
  36.   END;
  37.  
  38. PROCEDURE GetVolume(paramPtr: XCmdPtr);
  39.     VAR
  40.         oldVolume : Integer ;
  41.         loldVolume : LongInt ;
  42.         pasStr : Str255 ;
  43.  
  44.     {$I XCmdGlue.inc }
  45.  
  46.     BEGIN
  47.         GetSoundVol (oldVolume) ;                        { Get the volume }
  48.         loldVolume := oldVolume ;
  49.         pasStr := NumToStr(loldVolume) ;                { Convert number to string }
  50.         paramPtr^.returnValue := PasToZero(pasStr) ;    { Return the value }
  51.     END;
  52.  
  53.  
  54. END.
  55.  
  56.